package com.tuanzi.loan.vo.response.statistics.union;

import com.tuanzi.loan.core.vo.IdentityResponse;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.text.DecimalFormat;
import java.util.Date;

/**
 * User: liangZongXi
 * Create time: 11:00 2019/9/10
 * Description:
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class NewUnionLoginStatResponse  extends IdentityResponse {
    private Date createDate;
    private String parentId;
    private String productName;
    private String platform;
    private String channel;
    private Integer unionLoginType;
    private Long activity;
    private Integer reqNum;
    private Integer newNum;
    private Integer oldNum;

    public String getUserRate(){
        if(null == newNum || 0 == newNum){
            return "0";
        }

        DecimalFormat df = new DecimalFormat("#.##");
        return df.format((double)newNum/reqNum*100);
    }
}
